package indi.zhifa.engine.core.excel;

import indi.zhifa.engine.core.excel.entity.BaseExcelSheetRowData;
import org.apache.poi.ss.usermodel.Sheet;


public abstract class HzdlExcelSheetHandler extends BaseSheetHandler{
    protected HzdlExcelSheetHandler(Class pRowDataClass) {
        super(pRowDataClass);
    }

    @Override
    public void loadData(Object pMask) {
        //readFromDB((List<UploadStatus>)pMask);
    }

    /**
     * 导出的回调
     *
     * @param pSheet 要导出到的sheet
     */
    @Override
    public void export(Sheet pSheet) throws IllegalAccessException {

    }

    /**
     * 添加一行数据的回调
     *
     * @param pExcelSheetRowData 行数据
     * @param pMask              掩码
     */
    @Override
    public void addExcelSheetRowData(BaseExcelSheetRowData pExcelSheetRowData, Object pMask) {
        addExcelSheetRowData(pExcelSheetRowData);
    }


    /**
     * 多数情况下，不需要掩码添加数据
     *
     * @param pExcelSheetRowData 行数据
     */
    public abstract void addExcelSheetRowData(BaseExcelSheetRowData pExcelSheetRowData);

    //public abstract void readFromDB(List<UploadStatus> pUploadStatus);

    /**
     * 保存的回调
     */
    public abstract void save(Object pParam);

    /**
     * 保存数据
     */
    public void save(){
        save(null);
    }
}
